<%-- 
    Document   : main
    Created on : Feb 14, 2012, 9:33:28 AM
    Author     : administrator2
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%-- Header Area --%>
<%@ include file="/template/header.jsp" %> 
<%-- End of Header Area --%>


<%-- Content Area --%>
<h2>Account Profile</h2>

<div class="submenu">
    <ul>
        <li><a href="/account/profile">Personal Information</a></li>
        <li><a href="/account/info">My Addresses</a></li>
        <li><a href="/account/history">Order History</a></li>
    </ul>
    <div class="clear"></div>
</div>

<div style="width: 650; margin: 0 auto;">
<form method="POST" action="/account/update">   
    <table class="generic-vertical-table">
        <input type="hidden" name="id" value="<%= customer.getId()%>" />
        <tr>
            <td for="firstname" align ="right">First Name*</td> 
            <td><input type ="text" id="firstname" name ="firstname" value ="<%= customer.getFirstName()%>" validate="form" require="<b>Required Field Missing</b><br/>Please enter your first name." /></td>
        </tr>
        <tr>
            <td for="lastname" align ="right">Last Name*</td> 
            <td><input type ="text" id="lastname" name ="lastname" value ="<%= customer.getLastName()%>" validate="form" require="<b>Required Field Missing</b><br/>Please enter your last name." /></td>
        </tr>
        <tr>
            <td for="contact" align ="right">Contact Number*</td>
            <td><input type ="text" id="contact" name ="contact" value ="<%= customer.getContact()%>" validate="form" require="<b>Required Field Missing</b><br/>Please enter your contact number." /></td>
        </tr>
        <tr>
            <td for="email" align ="right">Email*</td>
            <td><input type ="text" id="email" name ="email" value ="<%= customer.getEmail()%>" validate="form" require="<b>Required Field Missing</b><br/>Please enter your email address." email="<b>Invalid Email Address</b><br/>Email address must be in the form of example@address.com" /></td>

        </tr>
        <tr>
            <td for="password" align ="right">New Password</td>
            <td><input type ="password" id="password" name ="password" validate="form" regular="<b>Invalid Password</b><br/>The password must be 6 characters or longer." validExpress=".{6,}" ></td>

        </tr>
        <tr>
            <td for="confirmpass" align ="right">Confirm New Password</td>
            <td><input type ="password" id="cPassword" name ="cPassword"  validate="form" compare="<b>Password Mismatch</b><br/>The password and confirm password fields must match." compareTo="password"></td>

        </tr>
        <tr>
            <td align ="right">Gender</td>
            <% if (customer.getGender().equals("M")) {%>
            <td><label><input type ="radio" name ="gender" value="M" checked ="checked">Male</label>
                <label><input type ="radio" name ="gender" value="F" >Female</label></td>
                    <% } else {%>
            <td><label><input type ="radio" name ="gender" value="M" >Male</label>
                <label><input type ="radio" name ="gender" value="F" checked ="checked">Female</label></td>
                    <% }%>
        </tr>
        <tr>
            <td align ="right">Birth Date</td>
            <td><input readonly="readonly" id="birthdate"  class="birthdate" validate="form" type ="text" name="birthdate" value ="<%= customer.getBirthDate()%>" ></td>
        </tr>
        <tr>
            <td colspan="2" align="right">
                <input type="submit" name="editProfile" value="Save" onclick="return validate('form');"/>
                <input type="button" value="Reset" onclick="reload()" />
            </td>
        </tr>
    </table>
</form>
</div>
<%-- End of Content Area --%>


<%-- Footer Area --%>
<%@ include file="/template/footer.jsp" %>
<%-- End of Footer Area --%>
